package com.appwoo.txtws.activity;

import android.app.Dialog;
import android.content.Context;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.txtws.adapter.ListViewCreator;
import com.appwoo.txtws.adapter.Page;
import com.appwoo.txtws.adapter.SimpleListAdapter;
import com.appwoo.txtws.app.App;
import com.appwoo.txtws.app.AppActivity;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.bean.WebTypeBean;
import com.appwoo.txtws.component.Arith;
import com.appwoo.txtws.component.Logger;
import com.appwoo.txtws.component.RqSP;
import com.appwoo.txtws.service.SoftLimitService;
import com.appwoo.txtws.service.WebLimitService;
import com.appwoo.txtws.wheel.widget.PageListView;
import com.appwoo.txtws.wheel.widget.PageListView.OnRefreshListener;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParserException;

public class WebLimitManager extends AppActivity
{
  protected static final int GUIUPDATEIDENTIFIER = 257;
  private static final String TAG = "WebLimitManager";
  private String addURL = "";
  private EditText add_url;
  private TextView add_web_limit;
  private boolean blDataTask;
  private Button button;
  private TextView del_no;
  private TextView del_yes;
  private TextView delete;
  private List<WebTypeBean> events;
  private int flag = 0;
  private boolean isFoot = false;
  private boolean isLimit = true;
  private boolean isLimitClick;
  private boolean isStyleClick;
  private boolean ishandle;
  private ImageView moreset;
  private List<WebTypeBean> newlist;
  private RelativeLayout no_info;
  private Page<WebTypeBean> page = new Page();
  private RelativeLayout rl;
  private List<WebTypeBean> style_events;
  private Page<WebTypeBean> style_page = new Page();
  private TextView text_alert;
  private RadioButton webLimit;
  private RadioButton webStyle;
  private PageListView web_limit;
  private PageListView web_style;
  private SimpleListAdapter<WebTypeBean> weblimit;
  private SimpleListAdapter<WebTypeBean> webstyle;

  private void SetWebEvent(int paramInt)
  {
    for (int i = 0; ; i++)
    {
      if (i >= this.page.getEntries().size())
      {
        this.weblimit.notifyDataSetChanged();
        return;
      }
      ((WebTypeBean)this.page.getEntries().get(i)).setFlag_id(paramInt);
    }
  }

  private void addAllWebSite()
  {
    System.out.println("WebLimitManager" + this.page.getEntries().size());
    for (int i = 0; ; i++)
    {
      if (i >= this.page.getEntries().size())
      {
        this.weblimit.notifyDataSetChanged();
        return;
      }
      if (!this.newlist.contains(this.page.getEntries().get(i)))
        this.newlist.add((WebTypeBean)this.page.getEntries().get(i));
    }
  }

  private boolean checkURL(String paramString)
  {
    boolean bool = true;
    if (paramString.equals(""))
    {
      bool = false;
      alertMessage(getString(2131427587));
    }
    do
    {
      return bool;
      if (!Arith.isURL(paramString))
      {
        alertMessage(getString(2131427590));
        return false;
      }
    }
    while (!paramString.contains(getString(2131427508)));
    alertMessage(getString(2131427598));
    return false;
  }

  private void initActionBar()
  {
    setBarTitle(getResources().getString(2131428127));
    setBarBackOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        WebLimitManager.this.finish();
      }
    });
    setBarHomeText(getResources().getString(2131427535));
    showBarHomeBtn(Boolean.valueOf(true));
    this.button = ((Button)findViewById(2131492864).findViewById(2131493279));
    this.button.setBackgroundDrawable(getResources().getDrawable(2130838112));
    LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams)this.button.getLayoutParams();
    localLayoutParams.height = 50;
    localLayoutParams.width = 85;
    this.button.setLayoutParams(localLayoutParams);
    this.button.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (WebLimitManager.this.flag == 0)
        {
          WebLimitManager.this.setBarHomeText(WebLimitManager.this.getResources().getString(2131428135));
          WebLimitManager.this.flag = 1;
          WebLimitManager.this.delete.setVisibility(0);
          WebLimitManager.this.delete.setText(WebLimitManager.this.getString(2131427535));
          WebLimitManager.this.rl.setBackgroundColor(WebLimitManager.this.getResources().getColor(2131230730));
          WebLimitManager.this.add_web_limit.setVisibility(8);
          WebLimitManager.this.weblimit.notifyDataSetChanged();
          WebLimitManager.this.newlist.clear();
        }
        do
        {
          return;
          if (WebLimitManager.this.flag == 1)
          {
            WebLimitManager.this.setBarHomeText(WebLimitManager.this.getResources().getString(2131427514));
            WebLimitManager.this.addAllWebSite();
            WebLimitManager.this.SetWebEvent(1);
            WebLimitManager.this.delete.setText("删除 （" + WebLimitManager.this.newlist.size() + "）项");
            WebLimitManager.this.flag = 2;
            return;
          }
          if (WebLimitManager.this.flag == 2)
          {
            WebLimitManager.this.flag = 3;
            WebLimitManager.this.removeAllWebSite();
            WebLimitManager.this.delete.setText("删除 （" + WebLimitManager.this.newlist.size() + "）项");
            WebLimitManager.this.SetWebEvent(0);
            return;
          }
        }
        while (WebLimitManager.this.flag != 3);
        WebLimitManager.this.delete.setVisibility(8);
        WebLimitManager.this.flag = 0;
        WebLimitManager.this.removeAllWebSite();
        WebLimitManager.this.SetWebEvent(0);
        WebLimitManager.this.rl.setBackgroundColor(WebLimitManager.this.getResources().getColor(2131230728));
        WebLimitManager.this.add_web_limit.setVisibility(0);
        WebLimitManager.this.setBarHomeText(WebLimitManager.this.getResources().getString(2131427535));
        WebLimitManager.this.weblimit.notifyDataSetChanged();
      }
    });
  }

  private void initAdapter()
  {
    if (this.isLimit)
    {
      this.weblimit = new SimpleListAdapter(this.page.getEntries(), new ListViewCreator()
      {
        private int flag_id;

        public View createView(final WebTypeBean paramAnonymousWebTypeBean, View paramAnonymousView, int paramAnonymousInt)
        {
          if (paramAnonymousView == null)
            paramAnonymousView = App.getLayoutInflater().inflate(2130903230, null);
          TextView localTextView1 = (TextView)paramAnonymousView.findViewById(2131493332);
          TextView localTextView2 = (TextView)paramAnonymousView.findViewById(2131493640);
          TextView localTextView3 = (TextView)paramAnonymousView.findViewById(2131493331);
          final CheckBox localCheckBox = (CheckBox)paramAnonymousView.findViewById(2131493011);
          if (WebLimitManager.this.flag == 0)
          {
            localCheckBox.setVisibility(8);
            this.flag_id = paramAnonymousWebTypeBean.getFlag_id();
            if (this.flag_id != 1)
              break label151;
            localCheckBox.setChecked(true);
          }
          while (true)
          {
            localCheckBox.setOnClickListener(new View.OnClickListener()
            {
              public void onClick(View paramAnonymous2View)
              {
                if (localCheckBox.isChecked())
                {
                  paramAnonymousWebTypeBean.setFlag_id(1);
                  WebLimitManager.this.newlist.add(paramAnonymousWebTypeBean);
                  WebLimitManager.this.delete.setText("删除 （" + WebLimitManager.this.newlist.size() + "）项");
                  return;
                }
                paramAnonymousWebTypeBean.setFlag_id(0);
                if (WebLimitManager.this.newlist.contains(paramAnonymousWebTypeBean))
                  WebLimitManager.this.newlist.remove(paramAnonymousWebTypeBean);
                WebLimitManager.this.delete.setText("删除 （" + WebLimitManager.this.newlist.size() + "）项");
              }
            });
            localTextView1.setText(paramAnonymousWebTypeBean.getTypeName());
            localTextView2.setText(paramAnonymousWebTypeBean.getURL());
            localTextView3.setText(paramAnonymousWebTypeBean.getType());
            return paramAnonymousView;
            localCheckBox.setVisibility(0);
            break;
            label151: localCheckBox.setChecked(false);
          }
        }
      });
      this.web_limit.setAdapter(this.weblimit);
      this.web_limit.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener()
      {
        public boolean onItemLongClick(AdapterView<?> paramAnonymousAdapterView, View paramAnonymousView, int paramAnonymousInt, long paramAnonymousLong)
        {
          if (WebLimitManager.this.flag == 0)
          {
            if (!WebLimitManager.this.newlist.contains(WebLimitManager.this.page.getEntries().get(paramAnonymousInt)))
              WebLimitManager.this.newlist.add((WebTypeBean)WebLimitManager.this.page.getEntries().get(paramAnonymousInt));
            String str = "将删除当前所选的 " + WebLimitManager.this.newlist.size() + " 项记录";
            WebLimitManager.this.DeleteRecordDialog(WebLimitManager.this, str);
          }
          return false;
        }
      });
      addOperation(new DataTask().execute(new String[] { "weblimit" }));
      return;
    }
    this.webstyle = new SimpleListAdapter(this.style_page.getEntries(), new ListViewCreator()
    {
      private int flag_id;
      private CheckBox style_cb;
      private TextView style_name;
      private TextView style_type;

      public View createView(WebTypeBean paramAnonymousWebTypeBean, View paramAnonymousView, int paramAnonymousInt)
      {
        if (paramAnonymousView == null)
          paramAnonymousView = App.getLayoutInflater().inflate(2130903232, null);
        this.style_name = ((TextView)paramAnonymousView.findViewById(2131493332));
        this.style_type = ((TextView)paramAnonymousView.findViewById(2131493331));
        this.style_cb = ((CheckBox)paramAnonymousView.findViewById(2131493011));
        this.style_name.setText(paramAnonymousWebTypeBean.getTypeName());
        this.flag_id = paramAnonymousWebTypeBean.getFlag_id();
        if (this.flag_id == 1)
        {
          this.style_cb.setChecked(true);
          return paramAnonymousView;
        }
        this.style_cb.setChecked(false);
        return paramAnonymousView;
      }
    });
    this.web_style.setAdapter(this.webstyle);
    this.web_style.setOnScrollListener(new AbsListView.OnScrollListener()
    {
      public void onScroll(AbsListView paramAnonymousAbsListView, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3)
      {
      }

      public void onScrollStateChanged(AbsListView paramAnonymousAbsListView, int paramAnonymousInt)
      {
        if ((paramAnonymousInt == 0) && (paramAnonymousAbsListView.getLastVisiblePosition() == -1 + paramAnonymousAbsListView.getCount()) && (!WebLimitManager.this.web_style.getIsNoMore()) && (WebLimitManager.this.blDataTask))
        {
          WebLimitManager.this.web_style.prepareForRefreshMore();
          WebLimitManager.this.isFoot = false;
          WebLimitManager.this.loadingData(false);
        }
      }
    });
    this.web_style.setOnLoadMoreListener(new PageListView.OnRefreshListener()
    {
      public void onRefresh()
      {
        WebLimitManager.this.web_style.prepareForRefreshMore();
        WebLimitManager.this.isFoot = false;
        WebLimitManager.this.loadingData(true);
      }
    });
    addOperation(new DataTask().execute(new String[] { "webstyle" }));
  }

  private void initView()
  {
    this.newlist = new ArrayList();
    this.webLimit = ((RadioButton)findViewById(2131493340));
    this.webStyle = ((RadioButton)findViewById(2131493341));
    this.web_limit = ((PageListView)findViewById(2131493343));
    this.web_style = ((PageListView)findViewById(2131493344));
    this.no_info = ((RelativeLayout)findViewById(2131493337));
    this.add_web_limit = ((TextView)findViewById(2131493346));
    this.delete = ((TextView)findViewById(2131493339));
    this.rl = ((RelativeLayout)findViewById(2131493019));
    this.webLimit.setChecked(true);
    this.web_style.setVisibility(8);
    this.web_limit.setVisibility(8);
    this.no_info.setVisibility(8);
    this.text_alert = ((TextView)findViewById(2131493022));
    this.delete.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (WebLimitManager.this.newlist.size() > 0)
        {
          System.out.println("WebLimitManager" + WebLimitManager.this.newlist.size());
          String str = "将删除当前所选的 " + WebLimitManager.this.newlist.size() + " 项记录";
          WebLimitManager.this.DeleteRecordDialog(WebLimitManager.this, str);
          return;
        }
        System.out.println("WebLimitManager" + WebLimitManager.this.newlist.size());
        WebLimitManager.this.alertMessage("没有选择数据");
      }
    });
    this.add_web_limit.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (WebLimitManager.this.isLimit)
          WebLimitManager.this.AddWebSiteDialog(WebLimitManager.this);
      }
    });
    this.webLimit.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        WebLimitManager.this.flag = 0;
        WebLimitManager.this.isFoot = false;
        WebLimitManager.this.blDataTask = true;
        WebLimitManager.this.isLimit = true;
        WebLimitManager.this.button.setVisibility(0);
        WebLimitManager.this.button.setText(WebLimitManager.this.getString(2131427535));
        WebLimitManager.this.delete.setText(WebLimitManager.this.getString(2131427535));
        WebLimitManager.this.add_web_limit.setText(WebLimitManager.this.getResources().getString(2131428130));
        WebLimitManager.this.web_style.setVisibility(8);
        WebLimitManager.this.web_limit.setVisibility(8);
        WebLimitManager.this.no_info.setVisibility(8);
        if ((!WebLimitManager.this.isLimitClick) && (WebLimitManager.this.page.getEntries().size() == 0))
        {
          WebLimitManager.this.no_info.setVisibility(0);
          WebLimitManager.this.isLimitClick = true;
        }
        do
        {
          return;
          if ((!WebLimitManager.this.isLimitClick) && (WebLimitManager.this.page.getEntries().size() != 0))
          {
            WebLimitManager.this.web_limit.setVisibility(0);
            WebLimitManager.this.isLimitClick = true;
            return;
          }
          if ((WebLimitManager.this.isLimitClick) && (WebLimitManager.this.page.getEntries().size() == 0))
          {
            WebLimitManager.this.no_info.setVisibility(0);
            return;
          }
        }
        while ((!WebLimitManager.this.isLimitClick) || (WebLimitManager.this.page.getEntries().size() == 0));
        WebLimitManager.this.web_limit.setVisibility(0);
      }
    });
    this.webStyle.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        WebLimitManager.this.isFoot = false;
        WebLimitManager.this.blDataTask = true;
        WebLimitManager.this.isLimit = false;
        WebLimitManager.this.SetWebEvent(0);
        WebLimitManager.this.newlist.clear();
        WebLimitManager.this.button.setVisibility(8);
        WebLimitManager.this.delete.setVisibility(8);
        WebLimitManager.this.add_web_limit.setVisibility(0);
        WebLimitManager.this.add_web_limit.setText(WebLimitManager.this.getResources().getString(2131427479));
        WebLimitManager.this.rl.setBackgroundColor(WebLimitManager.this.getResources().getColor(2131230728));
        WebLimitManager.this.web_style.setVisibility(8);
        WebLimitManager.this.web_limit.setVisibility(8);
        WebLimitManager.this.no_info.setVisibility(8);
        if (!WebLimitManager.this.isStyleClick)
        {
          WebLimitManager.this.initAdapter();
          WebLimitManager.this.isStyleClick = true;
        }
        while (!WebLimitManager.this.isStyleClick)
          return;
        WebLimitManager.this.web_style.setVisibility(0);
      }
    });
  }

  private void loadingData(boolean paramBoolean)
  {
    if (this.isLimit)
    {
      if (paramBoolean)
        this.page.firstPage();
      while (true)
      {
        addOperation(new DataTask().execute(new String[] { "weblimit" }));
        return;
        this.page.nextPage();
      }
    }
    if (paramBoolean)
      this.style_page.firstPage();
    while (true)
    {
      addOperation(new DataTask().execute(new String[] { "webstyle" }));
      return;
      this.style_page.nextPage();
    }
  }

  private void removeAllWebSite()
  {
    for (int i = 0; ; i++)
    {
      if (i >= this.page.getEntries().size())
        return;
      this.newlist.remove(this.page.getEntries().get(i));
    }
  }

  public void AddWebLimit(String paramString)
  {
    if (paramString.equals("0"))
    {
      alertMessage(getString(2131427520));
      if (this.no_info.isShown())
        this.no_info.setVisibility(8);
      this.page.getEntries().clear();
      new DataTask().execute(new String[] { "weblimit" });
      return;
    }
    alertMessage(paramString);
  }

  protected void AddWebSiteDialog(Context paramContext)
  {
    View localView = getLayoutInflater().inflate(2130903229, null);
    final Dialog localDialog = new Dialog(paramContext, 2131361814);
    localDialog.setContentView(localView);
    this.add_url = ((EditText)localView.findViewById(2131493637));
    TextView localTextView1 = (TextView)localView.findViewById(2131493639);
    TextView localTextView2 = (TextView)localView.findViewById(2131493638);
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        String str = WebLimitManager.this.add_url.getText().toString();
        if (WebLimitManager.this.checkURL(str))
        {
          WebLimitManager.this.addURL = str;
          Logger.e("System.out", WebLimitManager.this.addURL);
          new WebLimitManager.AddDataTask(WebLimitManager.this).execute(new String[] { "addlimit" });
          localDialog.dismiss();
        }
      }
    });
    localDialog.show();
  }

  protected void DeleteRecordDialog(Context paramContext, String paramString)
  {
    View localView = getLayoutInflater().inflate(2130903083, null);
    final Dialog localDialog = new Dialog(paramContext, 2131361814);
    localDialog.setContentView(localView);
    ((TextView)localView.findViewById(2131492904)).setText(paramString);
    TextView localTextView1 = (TextView)localView.findViewById(2131493071);
    TextView localTextView2 = (TextView)localView.findViewById(2131493070);
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
        if (WebLimitManager.this.flag == 0)
          WebLimitManager.this.newlist.clear();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        try
        {
          if (localDialog.isShowing())
            localDialog.dismiss();
          if (WebLimitManager.this.flag == 0)
          {
            new WebLimitManager.AddDataTask(WebLimitManager.this).execute(new String[] { "dellimit" });
            return;
          }
          new WebLimitManager.AddDataTask(WebLimitManager.this).execute(new String[] { "dellimit" });
          return;
        }
        catch (Exception localException)
        {
          localException.printStackTrace();
        }
      }
    });
    localDialog.show();
  }

  protected void backKeyCallBack()
  {
    finish();
  }

  public void onBackPressed()
  {
    finish();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903233);
    initActionBar();
    initView();
    initAdapter();
  }

  protected void showDialog(Context paramContext)
  {
    View localView = getLayoutInflater().inflate(2130903082, null);
    final Dialog localDialog = new Dialog(this, 2131361814);
    localDialog.setContentView(localView);
    this.del_yes = ((TextView)localView.findViewById(2131493068));
    this.del_no = ((TextView)localView.findViewById(2131493069));
    TextView localTextView1 = (TextView)localView.findViewById(2131493066);
    TextView localTextView2 = (TextView)localView.findViewById(2131493067);
    localTextView1.setText(getString(2131427522));
    localTextView2.setText(getString(2131427588));
    this.del_no.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
      }
    });
    this.del_yes.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localDialog.dismiss();
        new WebLimitManager.AddDataTask(WebLimitManager.this).execute(new String[] { "dellimit" });
      }
    });
    localDialog.show();
  }

  public String urlFilter(String paramString)
  {
    String str = paramString;
    if (paramString.contains("http://"))
      str = paramString.replace("http://", "");
    if (paramString.contains("https://"))
      str = paramString.replace("https://", "");
    if (paramString.contains("ftp://"))
      str = paramString.replace("ftp://", "");
    if (paramString.contains("www."))
      str = paramString.replace("www.", "");
    return str;
  }

  class AddDataTask extends AsyncTask<String, Integer, String>
  {
    private String TAG;
    private StateBean bean;
    private String param;

    AddDataTask()
    {
    }

    protected String doInBackground(String[] paramArrayOfString)
    {
      Logger.e(this.TAG, "过滤前--" + WebLimitManager.this.addURL);
      WebLimitManager.this.addURL = WebLimitManager.this.urlFilter(WebLimitManager.this.addURL);
      Logger.e(this.TAG, "过滤后--" + WebLimitManager.this.addURL);
      this.param = paramArrayOfString[0];
      RqSP localRqSP = new RqSP();
      String str1 = localRqSP.getLgDevAccount(WebLimitManager.this);
      String str2 = localRqSP.getLgDevId(WebLimitManager.this);
      String str3 = localRqSP.getLgPwd(WebLimitManager.this);
      Log.v(this.TAG, str1);
      Log.v(this.TAG, str2);
      try
      {
        if (this.param.equals("addlimit"))
        {
          this.bean = new WebLimitService().addLimitUrl(str1, str3, str2, WebLimitManager.this.addURL, WebLimitManager.this);
          if (this.bean != null)
          {
            boolean bool = this.bean.getCode().equals("0");
            if (bool)
              return "0";
            return this.bean.getDesc();
          }
          return WebLimitManager.this.getString(2131427771);
        }
        if (this.param.equals("dellimit"))
          this.bean = new SoftLimitService().delCommit(str1, str2, WebLimitManager.this.newlist, WebLimitManager.this);
        return null;
      }
      catch (IOException localIOException)
      {
        while (true)
          localIOException.printStackTrace();
      }
      catch (XmlPullParserException localXmlPullParserException)
      {
        while (true)
          localXmlPullParserException.printStackTrace();
      }
      catch (TimeOutException localTimeOutException)
      {
        while (true)
          localTimeOutException.printStackTrace();
      }
      catch (NotFoundNetWorkException localNotFoundNetWorkException)
      {
        while (true)
          localNotFoundNetWorkException.printStackTrace();
      }
    }

    protected void onPostExecute(String paramString)
    {
      if (this.param.equals("addlimit"))
        if (this.bean.getDesc().equals("成功"))
          WebLimitManager.this.AddWebLimit(paramString);
      while (true)
      {
        super.onPostExecute(paramString);
        return;
        WebLimitManager.this.alertMessage(this.bean.getDesc());
        continue;
        if (this.param.equals("dellimit"))
          if (this.bean.getDesc().equals("成功"))
          {
            WebLimitManager.this.page.getEntries().removeAll(WebLimitManager.this.newlist);
            WebLimitManager.this.weblimit.notifyDataSetChanged();
            WebLimitManager.this.newlist.clear();
            WebLimitManager.this.alertMessage(WebLimitManager.this.getResources().getString(2131427527));
          }
          else
          {
            WebLimitManager.this.alertMessage(WebLimitManager.this.getResources().getString(2131427528));
          }
      }
    }

    protected void onPreExecute()
    {
      super.onPreExecute();
    }
  }

  class DataTask extends AsyncTask<String, Integer, String>
  {
    private String TAG;
    private StateBean bean;
    private String param;

    DataTask()
    {
    }

    protected String doInBackground(String[] paramArrayOfString)
    {
      this.param = paramArrayOfString[0];
      RqSP localRqSP = new RqSP();
      String str1 = localRqSP.getLgDevAccount(WebLimitManager.this);
      String str2 = localRqSP.getLgDevId(WebLimitManager.this);
      localRqSP.getLgPwd(WebLimitManager.this);
      Log.v(this.TAG, str1);
      Log.v(this.TAG, str2);
      try
      {
        if (this.param.equals("weblimit"))
          WebLimitManager.this.events = new WebLimitService().getWebBlackList(str1, str2, WebLimitManager.this);
        else if (this.param.equals("webstyle"))
          WebLimitManager.this.style_events = new WebLimitService().getWebType(str1, str2, WebLimitManager.this.style_page.getPageNo(), WebLimitManager.this);
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
      catch (XmlPullParserException localXmlPullParserException)
      {
        localXmlPullParserException.printStackTrace();
      }
      catch (TimeOutException localTimeOutException)
      {
        localTimeOutException.printStackTrace();
      }
      catch (NotFoundNetWorkException localNotFoundNetWorkException)
      {
        localNotFoundNetWorkException.printStackTrace();
      }
      return null;
    }

    protected void onPostExecute(String paramString)
    {
      if (this.param.equals("weblimit"))
        if ((WebLimitManager.this.events != null) && (WebLimitManager.this.events.size() > 0))
        {
          WebLimitManager.this.page.addAllEntries(WebLimitManager.this.events);
          WebLimitManager.this.web_limit.setVisibility(0);
          WebLimitManager.this.weblimit.notifyDataSetChanged();
          WebLimitManager.this.web_limit.hideFotterMoreView();
          WebLimitManager.this.web_limit.setIsNoMore(true);
          WebLimitManager.this.events.clear();
          WebLimitManager.this.blDataTask = true;
          WebLimitManager.this.isFoot = true;
        }
      while (!this.param.equals("webstyle"))
        while (true)
        {
          if (WebLimitManager.this.isFoot)
          {
            WebLimitManager.this.closeProgress();
            WebLimitManager.this.isFoot = false;
          }
          super.onPostExecute(paramString);
          return;
          if (WebLimitManager.this.page.getEntries().size() == 0)
          {
            WebLimitManager.this.no_info.setVisibility(0);
          }
          else
          {
            WebLimitManager.this.web_limit.hideFotterMoreView();
            WebLimitManager.this.web_limit.setIsNoMore(true);
          }
        }
      if ((WebLimitManager.this.style_events != null) && (WebLimitManager.this.style_events.size() > 0))
      {
        WebLimitManager.this.style_page.addAllEntries(WebLimitManager.this.style_events);
        WebLimitManager.this.web_style.setVisibility(0);
        WebLimitManager.this.webstyle.notifyDataSetChanged();
        WebLimitManager.this.web_style.onLoadMoreComplete();
        if (WebLimitManager.this.style_events.size() < 10)
        {
          WebLimitManager.this.web_style.hideFotterMoreView();
          WebLimitManager.this.web_style.setIsNoMore(true);
        }
        WebLimitManager.this.style_events.clear();
      }
      while (true)
      {
        WebLimitManager.this.blDataTask = true;
        WebLimitManager.this.isFoot = true;
        break;
        if (WebLimitManager.this.style_page.getEntries().size() == 0)
        {
          WebLimitManager.this.no_info.setVisibility(0);
        }
        else
        {
          WebLimitManager.this.web_limit.hideFotterMoreView();
          WebLimitManager.this.web_limit.setIsNoMore(true);
        }
      }
    }

    protected void onPreExecute()
    {
      WebLimitManager.this.blDataTask = false;
      if (!WebLimitManager.this.isFoot)
        WebLimitManager.this.showProgress("");
      super.onPreExecute();
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.WebLimitManager
 * JD-Core Version:    0.6.2
 */